package com.lwhtarena.netty.netty4.util;

import java.io.FileNotFoundException;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.LinkedList;
import java.util.List;

public class FileInfo {
    private String filename;
    private String fileFormat;
    private long filesize;

    private RandomAccessFile randomAccessFile;
    public FileInfo() {
    }
    public FileInfo(String filename, String fileFormat, long filesize) {
        this.filename = filename;
        this.fileFormat = fileFormat;
        this.filesize = filesize;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getFileFormat() {
        return fileFormat;
    }

    public void setFileFormat(String fileFormat) {
        this.fileFormat = fileFormat;
    }

    public long getFilesize() {
        return filesize;
    }

    public void setFilesize(long filesize) {
        this.filesize = filesize;
    }

    public RandomAccessFile getRandomAccessFile() {
        return randomAccessFile;
    }



    public void setRandomAccessFile(String filePath) throws Exception {
        RandomAccessFile randomAccessFile = new RandomAccessFile(filePath,"rw");
        this.randomAccessFile = randomAccessFile;
    }
}
